package com.funds.web.servlet;

import javax.servlet.ServletContextEvent;
import javax.servlet.ServletContextListener;

import org.apache.log4j.PropertyConfigurator;
import org.springframework.web.context.ContextLoaderListener;

public class ApplicationListener extends ContextLoaderListener implements
		ServletContextListener {

	@Override
	public void contextInitialized(ServletContextEvent event) {
		String webRoot = event.getServletContext().getRealPath("");
		System.setProperty("web.root", webRoot);
		String configFilename = getClass().getResource("/log4j.properties").toString();
		PropertyConfigurator.configureAndWatch(configFilename, 1000 * 15);
		super.contextInitialized(event);
	}

}
